package com.souku.finance.application.push;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.souku.finance.application.R;
import com.souku.finance.application.ui.BlankActivity;
import com.souku.finance.application.base.ActivityManage;
import com.souku.finance.application.utils.Constant;
import com.souku.finance.application.utils.MyTextUtil;

/**
 * Created by Android on 2016/11/4.
 */

public class PushActivity extends Activity implements View.OnClickListener {

    protected TextView textContent;
    protected TextView textTime;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.setContentView(R.layout.act_push);
        initView();
        String content = getIntent().getStringExtra(Constant.Default);
        textContent.setText(content);
        textTime.setText(MyTextUtil.getSysTimeString());
    }

    @Override
    public void onClick(View view) {
        if (view.getId() == R.id.text_content) {

        }
    }

    private void initView() {
        textContent = (TextView) findViewById(R.id.text_content);
        textContent.setOnClickListener(PushActivity.this);
        textTime = (TextView) findViewById(R.id.text_time);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (!ActivityManage.isRun()) {
            Intent intent = new Intent(this, BlankActivity.class);
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
            startActivity(intent);
        }
    }
}
